package com.faxsun.core.order.service;

import java.util.List;

import javax.annotation.Resource;

import org.broadleafcommerce.common.util.TransactionUtils;
import org.broadleafcommerce.core.order.domain.Order;
import org.broadleafcommerce.core.order.domain.OrderAttribute;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.faxsun.core.order.dao.OrderAttributeDao;

@Service("fsOrderAttributeService")
public class OrderAttributeServiceImpl implements OrderAttributeService {

	@Resource(name="fsOrderAttributeDao")
	protected OrderAttributeDao orderAttributeDao;
	
	@Override
	@Transactional(value = TransactionUtils.DEFAULT_TRANSACTION_MANAGER)
	public OrderAttribute save(OrderAttribute orderAttribute) {
		return orderAttributeDao.save(orderAttribute);
	}

	@Override
	public OrderAttribute readAttributeById(long orderAttributeId) {
		return orderAttributeDao.readAtttributeById(orderAttributeId);
	}

	@Override
	public OrderAttribute create() {
		return orderAttributeDao.create();
	}

	@Override
	public List<OrderAttribute> readOrderAttributesForOrder(Order order) {
		return orderAttributeDao.readOrderAttributesForOrder(order);
	}

}
